package com.lyj.domain.es;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.Id;
import java.io.Serializable;

/**
 * Created by lyj on 2017/10/31.
 */
@Data
@Document(indexName = "blog",type = "blog") //文档
public class EsBlog implements Serializable{

    private static final long serialVersionUID = -2656697157047862600L;

    @Id //主键
    private String id;

    private String title;

    private String summary;

    private  String content;

    public EsBlog() { // JPA 规范要求 防止直接使用

    }

    public EsBlog(String id, String title, String summary, String content) {
        this.id = id;
        this.title = title;
        this.summary = summary;
        this.content = content;
    }

    @Override
    public String toString() {
        return "EsBlog{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", summary='" + summary + '\'' +
                ", content='" + content + '\'' +
                '}';
    }




}
